
<form name="form.new" novalidate="novalidate">
    <div class="help-doc-item help-doc" ng-show="toggle_help">
        <p>大厅接待使用此表单录入流量（接待）信息</p>
        <p>系统使用此表单提交的流量来生成各类销售、绩效报表，请务必<strong>认真填写</strong></p>
        <p>用户可以任意保存和修改表单，但是提交后<strong>无法删除</strong>，请谨慎提交</p>
        <p>试乘试驾和订单暂时<strong>无法保存</strong>，我们会尽快添加保存功能</p>
        <strong class="alert-danger">该表单会在每日晚上24点进行清理，所有无法正常提交的表单都会被清理（删除）</strong>
    </div>

    <div class="overlay-content">
        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    表单生成的日期，不能修改
                </p>
                <span class="overlay-name">日期</span>
                <input type="text" value="{{new_visit.date|date:'yyyy-MM-dd'}}" disabled>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    生成该流量的当前门店，无法修改
                </p>
                <span class="overlay-name">销售门店</span>
                <input type="text"
                       ng-model="new_visit.sales_shop_name"
                       disabled>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户到店时间 或者 <strong>邀约到店</strong>的时间
                </p>
                <span class="overlay-name">到店时间</span>
                <datetimepicker ng-model="new_visit.arrive_time"
                                format="hh:ii"
                                start-view="1"
                                max-view="1"

                                title="false"
                        ></datetimepicker>
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户离店时间
                    <br/>
                    在接触性质为 首次进入、再次进入、邀约到店时，离店时间必须填写
                </p>

                <span class="overlay-name">离店时间</span>
                <datetimepicker ng-model="new_visit.exit_time"
                                name = "exit_time"
                                format="hh:ii"
                                start-view="1"
                                max-view="1"
                                title="false"
                                start-date="new_visit.arrive_time"
                                ng-required = "(new_visit.entrance_type == '1' || new_visit.entrance_type == '2' || new_visit.entrance_type == '6')"
                        ></datetimepicker>

                <p ng-show="form.new.exit_time.$invalid" class="overlay-item-bottom">
                    在接触性质为 首次进入、再次进入、邀约到店时，离店时间必须填写
                </p>

            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    为此流量分配销售顾问,能选择的范围取决于当前用户的权限
                </p>
                <span class="overlay-name">销售顾问 </span>
                <salesman-picker ng-required="true" name="salesman" required
                        ng-model="new_visit.salesman"></salesman-picker>
                <p ng-show="form.new.salesman.$invalid" class="overlay-item-bottom">
                    销售顾问必填
                </p>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    务必核对潜客接触方式，该条目对于潜客分析很关键，特别是当潜客是再次进入时、谨慎选择
                </p>
                <span class="overlay-name">接触方式</span>
                <select ng-model="new_visit.meeting_type"
                        name="meeting_type"
                        ng-change="meeting_type_change()"
                        ng-required = "true" >
                    <option value="showroom">展厅</option>
                    <option value="dcc">DCC</option>
                </select>
                <p ng-show="form.new.meeting_type.$invalid" class="overlay-item-bottom ">
                    接触方式必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.meeting_type=='showroom'">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必核对潜客接触性质，谨慎选择
                </p>
                <span class="overlay-name">接触性质</span>
                <select ng-model="new_visit.entrance_type"
                        name="entrance_type"
                        ng-required="new_visit.meeting_type=='showroom'">
                    <option value="1">首次进入</option>
                    <option value="2">再次进入</option>
                    <option value="4">订单后</option>
                    <option value="3">非购车用户</option>
                </select>
                <p ng-show="form.new.entrance_type.$invalid" class="overlay-item-bottom ">
                    接触性质必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.meeting_type=='dcc'">
                <span class="overlay-name">接触性质</span>
                <select ng-model="new_visit.entrance_type" ng-required="new_visit.meeting_type=='dcc'" name="entrance_type_dcc">
                    <option value="5">在途</option>
                    <option value="6">邀约到店</option>
                    <option value="2">再次进入</option>
                    <option value="4">订单后</option>
                </select>
                <p ng-show="form.new.entrance_type_dcc.$invalid" class="overlay-item-bottom ">
                    接触性质必填
                </p>
            </div>
        </div>
        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的联系电话，潜客的唯一标记ID，只有下列情况可以不填:
                    <br> * 首次进入
                    <br> * 非购车
                    <br> ，其他情况必须是<i>11位合法的手机号码</i>
                    <br>
                    如果此潜客系统内登记过，系统会自动匹配
                </p>
                <span class="overlay-name">联系电话</span>
                <input type="text" ng-model="new_visit.phone"
                       name = "phone"
                       ng-blur="phone_blur(new_visit,new_visit.phone)"
                       ng-pattern = "/^[0-9]{11}$/"
                       ng-required = "new_visit.entrance_type != '3' && new_visit.entrance_type != '1' ">
                <p ng-show = "form.new.phone.$invalid" class="overlay-item-bottom">
                    客户的联系电话，潜客的唯一标记ID，只有下列情况可以不填:
                    <br> * 首次进入
                    <br> * 非购车
                    <br> ，其他情况必须是<i>11位合法的手机号码</i>
                </p>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的姓名，以流量实际拿到的为准，同一个潜客（相同登记号码视为同一个潜客）的姓名以最近一次录入的流量上的姓名为准
                </p>
                <span class="overlay-name">姓名</span>
                <input type="text" ng-model="new_visit.name">
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户的性别，无法确认则留空：）
                </p>
                <span class="overlay-name">性别</span>
                <select ng-model="new_visit.sex">
                    <option value="1">男</option>
                    <option value="2">女</option>
                </select>
            </div>

            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    无法确认留空、不要随意填写
                </p>
                <span class="overlay-name">兴趣爱好</span>
                <input type="text" ng-model="new_visit.habit">
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认潜客区域
                </p>
                <span class="overlay-name">客户区域</span>
                <select ng-model="new_visit.region">
                    <option value="新区">新区</option>
                    <option value="姑苏">姑苏</option>
                    <option value="园区">园区</option>
                    <option value="相城">相城</option>
                    <option value="吴中">吴中</option>
                    <option value="吴江">吴江</option>
                    <option value="常熟">常熟</option>
                    <option value="外区">外区</option>
                </select>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认潜客来源
                </p>
                <span class="overlay-name">来源</span>
                <select ng-model="new_visit.source">
                    <option value="1">路过</option>
                    <option value="2">网络</option>
                    <option value="3">广电</option>
                    <option value="4">基盘</option>
                    <option value="5">活动</option>
                    <option value="6">介绍</option>
                    <option value="7">全员销售</option>
                </select>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 4">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">客户名</span>
                <input type="text" ng-model="new_visit.jipan_customer_name" ng-required="new_visit.source == 4" name="jipan_customer_name">
                <p ng-show="form.new.jipan_customer_name.$invalid" class="overlay-item-bottom">
                    来源为基盘，客户名必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 4">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">客户联系方式</span>
                <input type="text" ng-model="new_visit.jipan_customer_phone" ng-required="new_visit.source == 4" name="jipan_customer_phone">
                <p ng-show="form.new.jipan_customer_phone.$invalid" class="overlay-item-bottom">
                    来源为基盘，客户联系方式必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 4">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">客户车牌号</span>
                <input type="text" ng-model="new_visit.jipan_customer_license_plate" ng-required="new_visit.source == 4" name="jipan_customer_license_plate">
                <p ng-show="form.new.jipan_customer_license_plate.$invalid" class="overlay-item-bottom">
                    来源为基盘，客户车牌号必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 7">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">门店</span>
                <input type="text" ng-model="new_visit.recommend_shop" ng-required="new_visit.source == 7" name="recommend_shop">
                <p ng-show="form.new.recommend_shop.$invalid" class="overlay-item-bottom">
                    来源为全员销售，门店必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 7">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">部门</span>
                <input type="text" ng-model="new_visit.recommend_dept" ng-required="new_visit.source == 7" name="recommend_dept">
                <p ng-show="form.new.recommend_dept.$invalid" class="overlay-item-bottom">
                    来源为全员销售，部门必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 7">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">客户名</span>
                <input type="text" ng-model="new_visit.recommend_name" ng-required="new_visit.source == 7" name="recommend_name">
                <p ng-show="form.new.recommend_name.$invalid" class="overlay-item-bottom">
                    来源为全员销售，客户名必填
                </p>
            </div>
            <div class="overlay-item" ng-show="new_visit.source == 7">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">

                </p>
                <span class="overlay-name">客户联系方式</span>
                <input type="text" ng-model="new_visit.recommend_phone" ng-required="new_visit.source == 7" name="recommend_phone">
                <p ng-show="form.new.recommend_phone.$invalid" class="overlay-item-bottom">
                    来源为全员销售，客户联系方式必填
                </p>
            </div>
            
            
            <div class="overlay-item" ng-show="new_visit.replacement_assessment==2||new_visit.replacement_assessment==3">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    当购买性质为换购和评估时,必填
                </p>
                <span class="overlay-name">评估师</span>
                <evaluator-picker ng-required="new_visit.replacement_assessment == 2 || new_visit.replacement_assessment == 3" name="appraiser" required
                                 ng-model="new_visit.appraiser"></evaluator-picker>
                <p ng-show="form.new.appraiser.$invalid"
                   class="overlay-item-bottom">
                    评估师必填
                </p>
            </div>
            
            
            
        </div>

        <div class="overlay-column overlay-column-3">
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help" >
                    务必核对潜客购买性质，该条目对于潜客分析很关键
                </p>
                <span class="overlay-name">购买性质</span>
                <select ng-model="new_visit.replacement_assessment"
                        ng-required = "true"
                        name = "replacement_assessment" >

                    <option value="0">首购</option>
                    <option value="1">增购</option>
                    <option value="2">换购</option>
                    <!-- <option value="3">评估</option> -->
                </select>
                <p ng-show="form.new.replacement_assessment.$invalid" class="overlay-item-bottom">
                    购买性质必填
                </p>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    务必确认试乘试驾
                </p>
                <span class="overlay-name">试乘试驾</span>
                <select ng-model="new_visit.is_test_drive">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
            <div class="overlay-item">
                <p class="overlay-item-top help-doc" ng-show="toggle_help">
                    客户级别选择，当前潜客等级是O级时可以<strong>下单</strong>
                </p>
                <span class="overlay-name">客户级别</span>
                <select ng-model="new_visit.customer_level">
                    <option value=""></option>
                    <option value="O" ng-show="new_visit.entrance_type != 5">O (订单)</option>
                    <option value="H">H (一周内）</option>
                    <option value="A">A (二周内）</option>
                    <option value="B">B (一个月）</option>
                    <option value="C">C (二个月）</option>
                    <option value="N">N (首次接触）</option>
                </select>
            </div>

            <div class="overlay-item" >
                <span class="overlay-name">意向车型</span>
                <vm-selector vehicle-model="add_vehicle"
                             level="1"
                        ></vm-selector>
            </div>
        </div>
        <div class=" overlay-item help-doc" ng-show="toggle_help"></div>
    </div>
</form>